#ifndef QIPAN_H
#define QIPAN_H

#include <QWidget>
#include <QMouseEvent>
#include "stdShared.h"



class QiPan : public QWidget
{
    Q_OBJECT
public:
    explicit QiPan(QWidget *parent = nullptr);



protected:
    void paintEvent(QPaintEvent *event) override;  //绘画事件

    void mouseMoveEvent(QMouseEvent *event)  override;  //鼠标移动事件


    void mousePressEvent(QMouseEvent *event) override;  //鼠标点击事件


signals:

public slots:


private:
    bool isCheckWin(int row,int col,ROLE role); //判断胜负

private:
     static const int m_boardSize = 15; //棋盘尺寸
    static const int m_cellSize = 40; //每个方格尺寸
     static const int m_margin = 20; //边缘距离

    ROLE m_board[m_boardSize][m_boardSize];  //棋盘上的点

     int m_hoverRow;
    int m_hoverCol;  //悬停点坐标

     bool m_hoverFlag;  //是否需要绘制悬停点



};

#endif // QIPAN_H
